﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using SSP;

namespace SSPDemo
{
    class testScene : SSPScene
    {
        SSPSprite test;
        SSPSprite test0;
        SSPSprite test1;
        SSPSprite test2;
        SSPSprite test3;
        SSPSpriteSheet testSheet;

        SSPCharacter character;

        public testScene()
        {
            character = new SSPCharacter();

            Console.WriteLine("hello");
            Console.WriteLine(this.GetType().BaseType);

            test = new SSPSprite("checkerbox");
            test.position = Vector2.Divide(SSPDirector.Instance.windowSize(), 2);


            test0 = new SSPSprite("MulticolorBox");
            test1 = new SSPSprite("MulticolorBox");
            test2 = new SSPSprite("atlas", 5, 5, 0, 1,true);
            test2.scale = new Vector2(3, 3);
            testSheet = new SSPSpriteSheet("atlas");
            test3 = new SSPSprite(testSheet, 0, 0, 200, 200);

            test0.position = new Vector2(50, 100);
            test1.position = new Vector2(100, 100);
            test1.scale = new Vector2(1f, 1f);

            test2.position = new Vector2(200, 200);
            test3.position = new Vector2(600, 200);

            test3.flipY = true;

            test0.addChild(test1);
            test0.addChild(test2);
            //this.addChild(test);
            this.addChild(test3);

            this.addChild(test0);
            this.addChild(character);
            SSPLevelProcessor xmlTest = new SSPLevelProcessor();
            SSPLevelDefinition testLevel = xmlTest.Read("test.xml");
            Console.WriteLine("array size is {0}", testLevel.backgroundElements.Count);
        }
    }
}
